﻿////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// <copyright>Copyright 2008-2011 Andreas Huber Doenni</copyright>
// Distributed under the GNU General Public License version 2 (GPLv2).
// See accompanying file License.txt or copy at http://phuse.codeplex.com/license.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

namespace Phuse.Net.Forums
{
    using System;

    /// <summary>Provides helper methods for entities.</summary>
    internal static class EntityHelper
    {
        internal static TEntity AssertNotDeleted<TEntity>(TEntity parent)
        {
            if (parent == null)
            {
                throw new InvalidOperationException("The entity has been deleted.");
            }

            return parent;
        }
    }
}
